package com.sc.nft.entity.vo;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
@ApiModel("用户商品寄售的时候详情信息")
public class GetUserConsignmentVO {

    @ApiModelProperty("发售价格")
    private String salePrice;

    @ApiModelProperty("最新成交价.这个成交价格是前一天的最后一笔价格")
    private String latestPrice;

    @ApiModelProperty("最低指导价")
    private String minPrice;

    @ApiModelProperty("最高指导价")
    private String maxPrice;

    @ApiModelProperty("商品名称")
    private String firstTitle;

    @ApiModelProperty("缩略图")
    private String creationContent;

    @ApiModelProperty("买入价格")
    private String buyPrice;

    @ApiModelProperty("最新成交价")
    private String newDeal;

    @ApiModelProperty("地板价")
    private String priceFloor;

    public void setPriceFloor(BigDecimal priceFloor) {
        this.priceFloor = ObjectUtil.isEmpty(priceFloor)?"0": priceFloor.setScale(2, BigDecimal.ROUND_DOWN).stripTrailingZeros().toPlainString();
    }

    public void setBuyPrice(BigDecimal buyPrice) {
        this.buyPrice = buyPrice.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

    public void setLatestPrice(BigDecimal latestPrice) {
        this.latestPrice = latestPrice.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

    public void setMinPrice(BigDecimal minPrice) {
        this.minPrice = minPrice.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

    public void setMaxPrice(BigDecimal maxPrice) {
        this.maxPrice = maxPrice.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

    public void setNewDeal(BigDecimal newDeal) {
        this.newDeal = newDeal.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

}

